package com.mcmaster.android;

import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.List;

import com.mcmaster.android.data.BuildingDatabase;
import com.mcmaster.android.data.Tour;
import com.mcmaster.android.data.TourDatabase;
import com.mcmaster.android.menus.MainMenu;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;

public class AndroidPhoneProjectActivity extends Activity 
{	
	public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.default_layout);
        
        try {
			BuildingDatabase.init(this, R.raw.building_database);
			TourDatabase.init(this, R.raw.tour_database);
		} catch (FileNotFoundException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}
        try {
			Tour t = TourDatabase.getTourFromName("Tour1");
			Log.e("MESS", t.getDescription());
		} catch (FileNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
//        // Test ADD TOUR
//        List<String> qr = new ArrayList<String>();
//        Tour t = new Tour();
//        
//        qr.add("f7f34f9f2jf92f4324324322f29fjk290fj");
//        qr.add("f7f34f9f2jf92fk9f2f2f2f29fjk290fj");
//        qr.add("f7f34f9f2jf92f4324324322f29fjk290fj");
//        t.name = "Tour2";
//        t.setBuildingQR(qr);
//        
//        TourDatabase.addTour(t);
        
        
        finish(); // This mode is needed only once.
        startActivity(new Intent(this, MainMenu.class));
    }
}